package com.mbyte.easy.config;

import com.mbyte.easy.util.OssUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @ClassName: OssProerties
 * @Description: 阿里云 对象云存储配置类
 * @Author: lxt （白章荣改）
 * @Date: 2019-02-14 09:37
 * @Version 1.0
 **/
@Component
@Data
public class OssProerties {
    @Value("${oss.aliyun.accessKeyId}")
    private  String accessKeyId;
    @Value("${oss.aliyun.accessKeySecret}")
    private  String accessKeySecret;
    @Value("${oss.aliyun.bucketName}")
    private  String bucketName;
    @Value("${oss.aliyun.endpoint}")
    private  String endpoint;
    @Value("${oss.aliyun.bucket}")
    private  String bucket;
    @Value("${oss.aliyun.expiration}")
    private  int  expiration;

    @PostConstruct
    public void init(){
        //Oss工具类配置初始化
        OssUtil.initConfig(this);
    }
}
